
from lingospot.decorate import wraps

# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------

def only( items ):
  items = tuple( items )
  assert len( items ) == 1
  return items[ 0 ]

# -----------------------------------------------------------------------------

def compose( inner, outer ):
  '''
  h( x ) = g( f( x ) 
  '''
    
  @wraps( outer )
  def composed( *a, **kw ):
    return outer(
      inner( *a, **kw )
    )

  return composed

